#!/bin/sh

. ~/.zshenv

if [ "$1" = "help" ]; then
    echo "*** Description ***" 
    echo "Takes a screenshot using slurp and grim then copys to clipboard using wl-copy"
    echo ""
    echo "*** Usage ***"
    echo "wl-screenshot"
    echo ""
    echo "*** Parameters ***"
    echo ""
    echo "*** Options ***"
    echo ""
    exit 0
fi

[ ! -d "$PICTURES"/screenshots ] && mkdir -p "$PICTURES"/screenshots
PIC_NUM="$(find "$PICTURES"/screenshots/ | wc -l)"
slurp | grim -g - "$PICTURES"/screenshots/scrn-"$PIC_NUM".png
wl-copy < "$PICTURES"/screenshots/scrn-"$PIC_NUM".png
